<!DOCTYPE html>
<html lang="cn">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>@yield('title')</title>
        <meta name="keywords" content="翻倍花，O2O，第三方推广，服务平台">
        <meta name="description" content="翻贝网致力于打造国内最具公信力的第三方推广和服务平台">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        @section('resources')
            <link rel="stylesheet" href="{{env('CSS_DOMAIN')}}css/console.css?v={{env('CSS_VERSION')}}">
            <link rel="stylesheet" href="{{env('CSS_DOMAIN')}}css/jquery.dataTables.min.css?v={{env('CSS_VERSION')}}">
            <link rel="shortcut  icon" type="image/x-icon" href="{{ env('IMAGE_DOMAIN') }}images/icon.png" media="screen"  />
        @show
        <style>
            .header_left{float: left;height: 60px;cursor: pointer;}
            .header_left img{float: left;width: 130px;margin: 7px 20px;}
            .header_right .duanxin_outer{padding: 0;width: 180px;display: none;}
            #all_city{border: 1px solid #000;margin-top: 16px;font-size: 18px;}
            .header_right .duanxin{background: url({{env('IMAGE_DOMAIN')}}/images/console/index_phone.png) 10px 11px no-repeat;float: left;width: 130px;height: 40px;line-height: 40px;padding-left: 40px;border: 1px solid #9955c6;border-radius: 10px;margin-top: 10px;}
            .header_right .header_houtai{background: url({{env('IMAGE_DOMAIN')}}/images/console/index_people.png) 10px 20px no-repeat;display: none;}
            .header_right .header_xitong{background: url({{env('IMAGE_DOMAIN')}}/images/console/index_setting.png) 10px 20px no-repeat;display: none;}
            .header_right .header_zhanghao{background: url({{env('IMAGE_DOMAIN')}}/images/console/index_password.png) 10px 20px no-repeat;display: none;}
            .backstage_list{width: 1200px;margin: 0 auto;}
            .backstage_list div{float: left;position: relative;width: 180px;height: 50px;text-align: center;line-height: 50px;display: none;}
            .backstage_list div ul{position: absolute;top: 50px;left: 0;width: 180px;z-index: 10000;background-color: #f7f7f7;display: none;}
            .backstage_list div ul li{float: left;width: 180px;height: 30px;line-height: 30px;text-align: center;}
            .mark{width: 100%;background: rgba(0,0,0,0.5);position: absolute;top: 0;left: 0;z-index: 200;display: none;}
            .mark_con{width: 600px;height: 500px;position: absolute;top: 50%;left: 50%;margin-left: -300px;margin-top: -250px;background-color: #fff;}
            .mark_con_top{width: 100%;height: 90px;line-height: 90px;border-bottom: 2px solid #9955c6;}
            .mark_con_top img{width: 30px;height: 30px;margin-right: 20px;margin-top: 25px;}
            #yzm_check p{overflow: hidden;margin-top: 50px;padding: 0 50px;}
            #yzm_check select{float: left;width: 96px;height: 46px;border: 2px solid #a4a4a4;border-radius: 10px;font-size: 18px;margin-left: 23px;}
            #yzm_check .phone_number{float: left;width: 356px;height: 46px;border: 2px solid #a4a4a4;border-radius: 10px;font-size: 18px;color: #a4a4a4;padding-left: 20px;}
            #yzm_check .yzm_btn{width: 500px;height: 50px;border-radius: 10px;font-size: 18px;color: #fff;margin-top: 30px;background: #9955c6;}
            .for_back{width: 500px;text-align: left;margin: 0 auto;margin-top: 30px;}
            .public_prompt_mark{width: 100%;position: fixed;top: 0;left: 0;z-index: 1000;display: none;}
            .public_prompt{width: 400px;position: fixed;top: 200px;left: 50%;margin-left: -200px;background-color: #fff;z-index: 1001;box-shadow: 0px 0px 5px 5px rgba(128,128,128,0.5);display: none;}
            .public_prompt img{width: 30px;height: 30px;position: absolute;top: 10px;right: 10px;z-index: 1001;}
            .public_prompt p{float: left;width: 100%;text-align: center;}
            .public_prompt .public_prompt_name{font-size: 24px;color: #343434;margin-top: 30px;}
            .public_prompt .public_prompt_ctn{font-size: 18px;color: #343434;margin: 30px 0;}
            .public_prompt .public_prompt_btn{font-size: 24px;color: #fff;width: 300px;height: 50px;line-height: 50px;margin-left: 50px;background-color: #9955c6;margin-bottom: 30px;border-radius: 10px;cursor: pointer;}
            .header_right ul a{display: none;}
            .backstage_list ul a{display: none;}
            .user_function ul li:hover{background-color: #e5e5e5;}
            .double_prompt{width: 400px;position: fixed;top: 200px;left: 50%;margin-left: -200px;background-color: #fff;z-index: 1001;box-shadow: 0px 0px 5px 5px rgba(128,128,128,0.5);padding: 10px;display: none;}
            .double_prompt p{float: left;width: 100%;text-align: center;}
            .double_prompt .double_prompt_content{margin: 10px 0;}
            .double_prompt p .double_prompt_title{width: 400px;font-size: 24px;color: #343434;line-height: 50px;}
            .double_prompt p img{width: 30px;height: 30px;position: absolute;top: 10px;right: 10px;z-index: 1001;}
            .double_prompt p button{width: 100px;height: 30px;}
            .double_prompt p .double_prompt_sure{margin-left: 30px;}
            .double_prompt p .double_prompt_cancel{margin-right: 30px;}
        </style>
    </head>

    <body>
        <p class="public_prompt_mark"></p>
        <header>
            <div class="header_left">
                <a href="/console/index"><img src="{{env('IMAGE_DOMAIN')}}/images/console/index_logo.png" alt=""></a>
                
                @if(env('WEB_URL')!="https://www.fbw-china.com/")
                    <select id="all_city" onchange="switch_city(this)" style="color: red;">

                    </select>
                @else
                    <select id="all_city" onchange="switch_city(this)">

                    </select>
                @endif
            </div>
            <div class="header_right">
                <div class="duanxin_outer"><p class="duanxin">短信验证码查询</p></div><!-- TODO 短信查询权限 -->
                <div class="header_houtai">
                    <span>用户后台管理</span>
                    <ul>
                        <a href="/console/admin/account/list" class="adminUserManagement"><li>后台管理账号</li></a>
                        <a href="/console/admin/role/management" class="adminRoleManagement"><li>角色管理</li></a>
                        <a href="/console/admin/agent/list" class="adminRoleManagement"><li>代理商管理</li></a>
                    </ul>
                </div>
                <div class="header_xitong">
                    <span>系统设置</span>
                    <ul>
                        <a href="/console/system/area/management" class="areaManagement"><li>地区管理</li></a>
                        <a href="/console/system/integral/rule" class="pointManagement"><li>积分规则</li></a>
                        <a href="/console/system/user/agreement" class="userAgreement"><li>用户协议</li></a>
                        <a href="/console/system/business/agreement" class="shopAgreement"><li>商家协议</li></a>
                        <a href="/console/system/app/version" class="appVersion"><li>app版本</li></a>
                        <a href="/console/system/red/envelope/intercalate" class="redEnvelope"><li>红包设置</li></a>
                    </ul>
                </div>
                <div class="header_zhanghao">
                    <span>账号设置</span>
                    <ul>
                        <a href="/console/account/info" style="display: block;"><li>账号信息</li></a>
                        <a href="#" style="display: block;"> <li class="check_password">修改密码</li></a>
                        <a href="/console/logout" style="display: block;"><li>退出登录</li></a>
                    </ul>
                </div>
            </div>
        </header>
        <section class="user_function">
            <div class="backstage_list">
                <div>
                    <span>用户版运营</span>
                    <ul>
                        <a href="/console/user/list" class="userManagement"><li>用户列表</li></a>
                        <a href="/console/user/region/list" class="userRegion"><li>地区用户</li></a>
                        <a href="/console/user/red/envelope" class="userRedEnvelope"><li>红包管理</li></a>
                        <a href="/console/user/banner/list" class="bannerManagement"><li>Banner列表</li></a>
                        <a href="/console/user/banner/appstart/list" class="appStartManagement"><li>启动页列表</li></a>
                        <a href="/console/user/search" class="searchManagement"><li>热搜管理</li></a>
                        <a href="/console/user/help" class="userHelpManagement"><li>帮助中心</li></a>
                        {{--<a href="/console/user/message/management" class="userMessageManagement"><li>消息管理</li></a>--}}
                        <a href="/console/user/feedback/management" class="userFeedbackManagement"><li>反馈管理</li></a>
                    </ul>
                </div>
                <div>
                    <span>商家版运营</span>
                    <ul>
                        <a href="/console/shop/list" class="shopManagement"><li>已上架商家列表</li></a>
                        <a href="/console/shop/waitlist" class="staffVerifyManagement"><li>审核不通过列表</li></a>
                        <a href="/console/shop/custom/waitlist" class="verifyManagement"><li>待审核商家列表</li></a>
                        <a href="/console/shop/downshelf/list" class="banShopManagement"><li>已下架商家列表</li></a>
                        <a href="/console/shop/status/list" class="shopStatus"><li>商家状态记录</li></a>
                        <a href="/console/shop/lastevent/list" class="shopStatus"><li>商家续签管理</li></a>
                        {{--<a href="/console/shop/code/manage"><li>商家二维码管理</li></a>--}}
                        <a href="/console/shop/doubleday/choose" class="doubleDayManagement"><li>翻倍日管理</li></a>
                         <a href="/console/shop/withoutevent/list" class="doubleDayManagement"><li>近期无翻倍日管理</li></a>
                        <a href="/console/shop/night/management" class="nightShopManagement"><li>夜场管理</li></a>
                        <a href="/console/shop/help" class="shopHelpManagement"><li>帮助中心</li></a>
                        {{--<a href="/console/shop/message/manage" class="shopMessageManagement"><li>消息管理</li></a>--}}
                        <a href="/console/shop/feedback/manage" class="shopFeedbackManagement"><li>反馈管理</li></a>
                        <a href="/console/shop/joinin" class="shopFeedbackManagement"><li>商家入驻</li></a>
                    </ul>
                </div>
                <div>
                    <span>订单管理</span>
                    <ul>
                        <a href="/console/order/recharge/list" class="rechargeManagement"><li>充值订单列表</li></a>
                        <a href="/console/order/consume/list" class="orderManagement"><li>消费订单列表</li></a>
                        <a href="/console/order/comment/list" class="commentManagement"><li>全部评价列表</li></a>
                        <a href="/console/order/recharge/refund/list" class="refundManagement"><li>充值退款记录</li></a>
                        <a href="/console/order/order/refund/list" class="refundManagement"><li>消费退款记录</li></a>
                        <a href="/console/order/report/list" class="reportManagement"><li>举报评论列表</li></a>
                        <a href="/console/order/business/review" class="shopCommentManagement"><li>商家回评列表</li></a>
                    </ul>
                </div>
                <div>
                    <span>财务中心</span>
                    <ul>
                        <a href="/console/finance/platform/money" class="ledgerAccount"><li>平台资金流水</li></a>
                        <a href="/console/finance/user/statement" class="userStatement"><li>用户对账单</li></a>
                        <a href="/console/finance/receivable/manage" class="shopStatement"><li>商家收款账号管理</li></a>
                        <a href="/console/finance/business/statement" class="shopStatement"><li>商家对账单</li></a>
                        <a href="/console/finance/waitmoney/list" class="waitWithdraw"><li>商家待提现列表</li></a>
                        <a href="/console/finance/gotmoney/list" class="alreadyWithdraw"><li>商家已提现列表</li></a>
                        {{--<a href="/console/finance/month/list"><li>商务月账单</li></a>--}}
                        <a href="/console/finance/salesman/statement/index" class="shopSalesmanStatement"><li>地推对账单</li></a>
                        <a href="/console/finance/salesman/waitwithdrawal/index" class="shopSalesmanWaitWithdrawal"><li>地推待提现</li></a>
                        <a href="/console/finance/salesman/withdrawal/index" class="shopSalesmanWithdrawal"><li>地推已提现</li></a>
                        <a href="/console/finance/agent/profit" class="agentProfit"><li>代理商分润</li></a><!-- TODO 没找到权限 -->
                        <a href="/console/finance/agent/statement" class="agentStatement"><li>代理商对账单</li></a>
                        <a href="/console/finance/agent/shopwaitwithdrawal" class="agentWaitWithdrawal"><li>代理商待提现</li></a>
                        <a href="/console/finance/agent/shopwithdrawal" class="agentWithdrawal"><li>代理商已提现</li></a>
                        <a href="/console/finance/agent/receivable/manage" class="agentReceivableManage"><li>代理收款账号管理</li></a>
                    </ul>
                </div>
                <div>
                    <span>地推管理</span>
                    <ul>
                        <a href="/console/salesman/shop/lists" class="shopSalesmanManagement"><li>地推商家列表</li></a>
                        <a href="/console/salesman/user/list" class="userSalesmanManagement"><li>个人地推列表</li></a>
                        <a href="/console/salesman/setup" class="salesmanSetManagement"><li>地推设置</li></a>
                    </ul>
                </div>
                <div>
                    <span>数据报表</span>
                    <ul>
                        <a href="/console/statistical/survey" class="statistical"><li>统计概况</li></a>
                        <a href="/console/statistical/order/shop/list" class="statistical"><li>商家订单统计</li></a>
                    </ul>
                </div>
            </div>
        </section>
        <div class="mark">
            <div class="mark_con tc">
                <p class="mark_con_top tc">
                    <span>短信验证码查询</span>
                    <img class="fr" src="{{env('IMAGE_DOMAIN')}}images/console/close_p.png" alt="">
                </p>
            <form method="post" action="" id="yzm_check">
                <p>
                    <input class="phone_number" type="text" name="smsmobile" value="" placeholder="请输入手机号">
                    <select name="smstype" id="">
                        <option value="user" selected="selected">用户版</option>
                        <option value="shop">商家版</option>
                    </select>
                </p>
                <input class="yzm_btn" type="button" name="smssubmit" value="查询">
            </form>
            <p class="for_back">验证码：<span class="smscode"></span></p>
            </div>
        </div>
        <div class="forget_password" style="z-index: 1001;">
            <p>
                <span class="co_gray81">修改密码</span>
                <img class="fr" src="{{env('IMAGE_DOMAIN')}}images/console/close_p.png" alt="">
            </p>
            <p>
                <input type="password" name="oldpassword" value="" placeholder="旧密码"><br>
                <input type="password" name="newpassword" value="" placeholder="新密码"><br>
                <input type="password" name="again" value="" placeholder="确认密码">
            </p>
            <button id="btn_check_password">确认</button>
        </div>
        <div class="public_prompt">
            <img class="prompt_close" src="{{env('IMAGE_DOMAIN')}}/images/console/close_p.png" alt="">
            <p class="public_prompt_name">权限访问</p>
            <p class="public_prompt_ctn">您的权限不够</p>
            <p class="public_prompt_btn">确定</p>
        </div>
        <div class="hot_search_mark doublebtn" style="z-index: 1001;">
            <p class="oh">
                <span class="fl doublebtn_title">开通今日翻倍</span>
                <img class="fr close" src="{{env('IMAGE_DOMAIN')}}images/close_p.png" alt="">
            </p>
            <p class="doublebtn_content">
                确定开通翻倍日？
            </p>
            <p>
                <button style="background-color: #9955c6;color: #fff;" class="sure fl">确定</button>
                <button class="cancel fr header_cancel">取消</button>
            </p>
        </div>
        <div class="double_prompt">
            <p class="oh">
                <span class="fl double_prompt_title">确认提示</span>
                <img class="fr double_prompt_close" src="{{env('IMAGE_DOMAIN')}}images/close_p.png" alt="">
            </p>
            <p class="double_prompt_content">
                确定开通翻倍日？
            </p>
            <p>
                <button style="background-color: #9955c6;color: #fff;" class="double_prompt_sure fl">确定</button>
                <button class="double_prompt_cancel fr">取消</button>
            </p>
        </div>
        @yield('content')
            
        @section('scriptResources')
        <script src="{{env('JS_DOMAIN')}}js/jquery-1.11.1.min.js?v={{env('JS_VERSION')}}"></script>
        <script src="{{env('JS_DOMAIN')}}js/jquery.dataTables.min.js?v={{env('JS_VERSION')}}"></script>
        @show
        <script>
            
            //判断当前所在页面并标注
            var locationUrl = window.location.pathname;
            for (var i = 0; i < $('ul a').length; i++) {
                if($('ul a').eq(i).attr("href") == locationUrl){
                    $('ul a').eq(i).children("li").css("color","#9955c6");
                }
            };
            // $(".public_prompt .close").click(function(){
            //     $(".public_prompt_mark").hide();
            //     $(".public_prompt").hide();return;
            // });
            //弹窗调用函数
            function public_prompt(){
                $(".public_prompt_mark").show();
                $(".public_prompt").show();
                $(".public_prompt_mark").height($(window).height());
                $(".public_prompt_btn").click(function(){
                    $(".public_prompt_mark").hide();
                    $(".public_prompt").hide();
                });
                $(".prompt_close").click(function(){
                    $(".public_prompt_mark").hide();
                    $(".public_prompt").hide();
                });
            }
            //双按钮弹窗调用函数
            function doublePrompt() {
                $(".public_prompt_mark").show();
                $(".public_prompt_mark").height($(window).height());
                $(".double_prompt").show();
                $(".double_prompt_close").click(function(){
                    $(".public_prompt_mark").hide();
                    $(".double_prompt").hide();
                });
                $(".double_prompt_cancel").click(function(){
                    $(".public_prompt_mark").hide();
                    $(".double_prompt").hide();
                });
            }
            locationUrl = locationUrl.split("/");
            // console.log(locationUrl)
            
            if(locationUrl[2] =="user"){
                $(".backstage_list div").eq(0).children('span').css("color","#9955c6");
            }else if(locationUrl[2] =="shop"){
                $(".backstage_list div").eq(1).children('span').css("color","#9955c6");
            }else if(locationUrl[2] =="order"){
                $(".backstage_list div").eq(2).children('span').css("color","#9955c6");
            }else if(locationUrl[2] =="finance"){
                $(".backstage_list div").eq(3).children('span').css("color","#9955c6");
            }else if(locationUrl[2] =="salesman"){
                $(".backstage_list div").eq(4).children('span').css("color","#9955c6");
            }else if(locationUrl[2] =="statistical"){
                $(".backstage_list div").eq(5).children('span').css("color","#9955c6");
            }else if(locationUrl[2] =="admin"){
                $(".header_houtai span").css("color","#9955c6");
            }else if(locationUrl[2] =="system"){
                $(".header_xitong span").css("color","#9955c6");
            }
            //查找短信验证码
            $("input[name='smssubmit']").click(function() {
                var smsmobile = $("input[name='smsmobile']").val();
                var smstype = $("select[name='smstype']").find("option:selected").val();
                var cityid = $("#all_city").find("option:selected").val();
                $.ajax({
                    url:"/console/sms/get",
                    type: "get",
                    data: {
                        mobile: smsmobile,
                        type: smstype,
                        cityid: cityid
                    },
                    dataType:'json',
                    success:function(data){
                        if(data.status == 'success') {
                            var data = data.data;
                            var code = data.code;
                            $('.smscode').text(code);
                        } else {
                            $('.smscode').text("查不到短信验证码");
                        }
                    }
                });
            });
            $(window).resize(function(){
                $(".mark").height($(window).height());
            })
            $(document).ready(function() {
                $('#example').DataTable();
            });
            $(function(){
                $(".mark").height($(window).height());
                $(".duanxin").click(function(){
                    $(".mark").show();
                })
                $.ajax({
                    url : '/console/auth/city/get',
                    type : 'get',
                    data: {},
                    dataType:'json',
                    success:function(data){
                        var all_city = data.data.allcity;
                        var cityid = data.data.cityid;
                        var cityname = data.data.cityname;
                        var city_str = '';
                        for(var i=0; i<all_city.length; i++) {
                            var list = all_city[i];
                            if(list.cityid == cityid) {
                                city_str += '<option value="' + list.cityid +'" selected="selected">' + list.cityname +'</option>';
                            } else {
                                city_str += '<option value="' + list.cityid +'">' + list.cityname +'</option>';
                            }
                        }
                        $("#all_city").html(city_str);
                        refresh_url(cityid);
                        duanxin_power(cityid);
                    }
                });
                //短信权限
                function duanxin_power(cityid){
                    $.ajax({
                        url : '/console/sms/auth/valid',
                        type : 'get',
                        data: {cityid:cityid},
                        dataType:'json',
                        success:function(data){
                            if(data.status == 'success') {
                                $(".duanxin_outer").show();
                            } else {
                                //alert(data.message)
                            }
                        }
                    });
                }
                $(".mark_con_top img").click(function(){
                    $(".mark").hide();
                })
                $(".header_houtai").mouseover(function(){
                    $(".header_houtai").css({"border-bottom":"2px solid #9955c6","background-color":"#f5eef9"});
                    $(".header_houtai ul").show();
                })
                $(".header_houtai").mouseout(function(){
                    $(".header_houtai").css({"border-bottom":"none","background-color":"#fff"});
                    $(".header_houtai ul").hide();
                })
                $(".header_xitong").mouseover(function(){
                    $(".header_xitong").css({"border-bottom":"2px solid #9955c6","background-color":"#f5eef9"});
                    $(".header_xitong ul").show();
                })
                $(".header_xitong").mouseout(function(){
                    $(".header_xitong").css({"border-bottom":"none","background-color":"#fff"});
                    $(".header_xitong ul").hide();
                })
                $(".header_zhanghao").mouseover(function(){
                    $(".header_zhanghao").css({"border-bottom":"2px solid #9955c6","background-color":"#f5eef9"});
                    $(".header_zhanghao ul").show();
                })
                $(".header_zhanghao").mouseout(function(){
                    $(".header_zhanghao").css({"border-bottom":"none","background-color":"#fff"});
                    $(".header_zhanghao ul").hide();
                })
                $(".local").click(function(event){
                    event.stopPropagation();
                    $(".selection").show();
                    $(".header_left .local").css("border","1px solid #eee");
                })
                $(document).click(function(){
                    $(".selection").hide();
                    $(".header_left .local").css("border","1px solid #fff");
                })
                $(".backstage_list div").mouseover(function(){
                    var i=$(this).index();
                    $(".backstage_list div").eq(i).css("background-color","#f7f7f7").siblings().css("background-color","#e5e5e5");
                    $(".backstage_list div").eq(i).children("ul").show();

                })
                    
                $(".backstage_list div").mouseout(function(){
                    var i=$(this).index();
                    $(".backstage_list div").eq(i).css("background-color","#e5e5e5");
                    $(".backstage_list div").eq(i).children("ul").hide();
                }) 
                $(".check_password").click(function(){
                    $(".forget_password").show();
                    $(".public_prompt_mark").show();
                    $(".public_prompt_mark").height($(window).height());
                    $(".public_prompt_mark").css({"background": "rgba(0,0,0,0.5)"});
                })
                $(".forget_password p img").click(function(){
                    $(".forget_password").hide();
                    $(".public_prompt_mark").hide();
                })
                $("#btn_check_password").click(function(){
                    var oldpassword=$('.forget_password input').eq(0).val();
                    var newpassword=$('.forget_password input').eq(1).val();
                    var checkpassword=$('.forget_password input').eq(2).val();
                    if((newpassword==checkpassword)&&(oldpassword!=newpassword)){
                        $.ajax({
                            url:"/console/password/reset",
                            type: "post",
                            data: {oldpassword:oldpassword,newpassword:newpassword,checkpassword:checkpassword},
                            dataType:'json',
                            success:function(data){
                                if(data.status == 'success') {
                                    $(".forget_password").hide();
                                    $(".public_prompt_mark").hide();
                                    alert(data.message);
                                    window.location.href="/console/logout";
                                } else {
                                    alert(data.message);
                                }
                            },
                            error:function(message){
                                $(".forget_password").show();
                            }
                        })
                    }else if(oldpassword==newpassword){
                        alert('新密码不能与旧密码相同');
                    }else{
                        alert('请再次确认密码');
                    }
                })
            })
            function refresh_url(cityid) {
                for (var i = 0; i < $("a").length; i++) {
                    var old_url = $("a").eq(i).attr('href');
                    if(old_url == undefined){
                        continue;
                    }else{
                        var param_exist = old_url.indexOf('?');
                        if(param_exist == -1) {
                            //url后面是否有参数
                            var new_url = old_url + "?cityid=" + cityid;
                        } else {
                            var new_url = old_url + "&cityid=" + cityid;
                        }
                        $("a").eq(i).attr('href', new_url);
                    }
                };
                // $("a").each(function(){
                //     var old_url = $(this).attr('href');
                //     var param_exist = old_url.indexOf('?');
                //     if(param_exist == -1) {
                //         //url后面是否有参数
                //         var new_url = old_url + "?cityid=" + cityid;
                //     } else {
                //         var new_url = old_url + "&cityid=" + cityid;
                //     }
                //     $(this).attr('href', new_url);
                // })
            }
            function switch_city(id) {
                var cityid = id.value;
                var cityname = $('#all_city').find('option:selected').text();
                $.ajax({
                    url:"/console/city/select",
                    type: "get",
                    data: {
                        cityid:cityid,
                        cityname:cityname
                    },
                    dataType:'json',
                    success:function(data){
                       window.location.href = "/console/index?cityid=" + cityid + '&now=' + new Date().getTime();;
                    }
                });
            }
            $('.cancel').click(function(){
                $(this).parent().parent().hide();
                // window.location.reload();
            })
            $(".close").click(function(){
                $(this).parent().parent().hide();
                // window.location.reload();
            })
            // var list = ["userManagement","userRedEnvelope","adminUserManagement","shopManagement","doubleDayManagement","shopSalesmanManagement"];
            // for (var i = 0; i < list.length; i++) {
            //     $('.'+list[i]) . show();
            // };
            // for (var i = 0; i < $("ul a").length; i++) {
            //     if($("ul a").eq(i).css("display") != 'none'){
            //         $("ul a").eq(i).parent().parent().show()
            //     }
            // };

            $.ajax({
               url : '/console/adminuser/auth/get',
               type : 'get',
               data: {},
               dataType:'json',
               success:function(data){
                    if(data.status == 'success') {
                        var data = data.data;
                        for(var i=0; i<=data.length; i++) {
                            var list = data[i];
                            $('.'+list) . show();
                        }
                        for (var i = 0; i < $("ul a").length; i++) {
                            if($("ul a").eq(i).css("display") != 'none'){
                                $("ul a").eq(i).parent().parent().show()
                            }
                        }
                    }
                }
            });

//          权限ajax请求
            function shopPower(power) {
                var shop_power = 0;
                $.ajax({
                    url : '/console/auth/type/valid',
                    type : 'get',
                    data : {
                        type : power
                    },
                    dataType : 'json',
                    async : false,
                    success : function (data) {
                        if(data.status == 'success'){
                            shop_power = 1;
                        }else {
                            shop_power = 0;
                        }
                    },
                    error: function (data) {
                        shop_power = 0;
                    }
                })
                return shop_power;
            }
        </script>
        {{--<script type='text/javascript'>--}}
            {{--//百度统计--}}
            {{--var _hmt = _hmt || [];--}}
            {{--(function() {--}}
              {{--var hm = document.createElement("script");--}}
              {{--hm.src = "//hm.baidu.com/hm.js?c02495d9d6295d84410920fc6a00e853";--}}
              {{--var s = document.getElementsByTagName("script")[0];--}}
              {{--s.parentNode.insertBefore(hm, s);--}}
            {{--})();--}}
        {{--</script>--}}
    </body>
</html>